#ifndef _CONTROL_POINT_H_
#define _CONTROL_POINT_H_

#include "./define_dx.h"

//! Simple control point structure
struct SIMPLE_CONTROL_POINT {
	unsigned int index;
	float m_vPosition[3];
};

// Create our vertex input layout - this matches the SIMPLE_CONTROL_POINT structure
const extern D3D11_INPUT_ELEMENT_DESC control_point_layout[];
const extern UINT control_point_layout_size;

//D3D11_INPUT_ELEMENT_DESC control_point_layout[2];

//control_point_layout[0].SemanticName = "INDEX";
//control_point_layout[0].SemanticIndex = 0;
//control_point_layout[0].Format = DXGI_FORMAT_R32_UINT;
//control_point_layout[0].InputSlot = 0;
//control_point_layout[0].AlignedByteOffset = 0;
//control_point_layout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
//control_point_layout[0].InstanceDataStepRate = 0;

//control_point_layout[1].SemanticName = "POSITION";
//control_point_layout[1].SemanticIndex = 0;
//control_point_layout[1].Format = DXGI_FORMAT_R32G32B32_FLOAT;
//control_point_layout[1].InputSlot = 0;
//control_point_layout[1].AlignedByteOffset = 4;
//control_point_layout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
//control_point_layout[1].InstanceDataStepRate = 0;

inline string& operator += ( string &str, const SIMPLE_CONTROL_POINT &obj ) {
	str += "Control Point " + itos( obj.index ) + " ( ";
	for( usint i = 0; i < 3; ++i )
		str += dtos( obj.m_vPosition[i] ) + " ";
	return str += ")";
};

inline string operator + ( const string &str, const SIMPLE_CONTROL_POINT &obj ) {
	string result = str;
	return result += obj;
};

inline string operator + ( const SIMPLE_CONTROL_POINT &obj, const string &str ) {
	return string("") + obj + str;
};

inline ostream& operator << ( ostream &out, const SIMPLE_CONTROL_POINT &obj ) {
	return out << string("") + obj;
};

#endif
